﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Text;
using Zj.HttpCodeDemo.Domain.Core;

namespace Zj.HttpCodeDemo.Repository.Models.Mapping
{
    public class TodoExtMap
        : EntityTypeConfiguration<TodoExt>
    {
        public TodoExtMap()
        {
            //table
            this.ToTable("TodoExt", "dbo");

            //keys
            HasKey(t => t.Id);


            //properties
            this.Property(t => t.Id)
                .HasColumnName("Id")
                .IsRequired();

            this.Property(t => t.Description)
                .HasColumnName("Description")
                .HasMaxLength(255)
                .IsRequired();

            this.Property(t => t.TodoId)
                .HasColumnName("TodoId")
                .IsRequired();

        }
    }
}
